package day20171118;

import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import java.io.IOException;
import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by 14394 on 2017/11/18.
 */
public class Test {
    public static void main(String[] args) throws MalformedURLException, IOException {
//		Document parse = Jsoup.parse(new URL("http://info.bet007.com/cn/team/Summary.aspx?TeamID=35"), 10000);
//		Document parse = Jsoup.parse(new URL("http://www.baidu.com"), 10000);
        Connection connect = Jsoup.connect("http://club.autohome.com.cn/bbs/threadqa-c-3980-68373466-1.html");
        Map<String, String> header = new HashMap<String, String>();
        header.put("Host", "x.autoimg.cn");
        header.put("User-Agent", "	Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0");
        header.put("Accept", "	text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
        header.put("Accept-Language", "zh-cn,zh;q=0.5");
        header.put("Accept-Charset", "	GB2312,utf-8;q=0.7,*;q=0.7");
        header.put("Connection", "keep-alive");
        Connection data = connect.data(header);
        Document document = data.get();

        System.out.println(document.html());
    }

}
